﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Mvc4TwitterBootstrap.Models;

namespace Mvc4TwitterBootstrap.Controllers
{
    /// <summary>
    /// Nur dazu da um zu zeigen wie die restlichen T4 Codetemplates angewendet aussehen.
    /// </summary>
    public class PersonController : Controller
    {
        //
        // GET: /Person/

        public ActionResult Create()
        {
            return View(new PersonModel() {Nachname = "Squad", Vorname = "Wuschel", Ort = "Dresden"});
        }

        public ActionResult Delete()
        {
            return View(new PersonModel() { Nachname = "Squad", Vorname = "Wuschel", Ort = "Dresden" });
        }

        public ActionResult Details()
        {
            return View(new PersonModel() { Nachname = "Squad", Vorname = "Wuschel", Ort = "Dresden" });
        }

        public ActionResult Edit()
        {
            return View(new PersonModel() { Nachname = "Squad", Vorname = "Wuschel", Ort = "Dresden" });
        }

        public ActionResult ClearPage()
        {
            return View();
        }

        public ActionResult List()
        {
            PersonenModel personenModel = new PersonenModel();
            List<PersonModel> pers = new List<PersonModel>();
            pers.Add(new PersonModel { Nachname = "Squad", Vorname = "Wuschel", Ort = "Dresden" });
            pers.Add(new PersonModel { Nachname = "Squad 1", Vorname = "Wuschel 1", Ort = "Leipzig" });
            pers.Add(new PersonModel { Nachname = "Squad 2", Vorname = "Wuschel 2", Ort = "Aue" });
            pers.Add(new PersonModel { Nachname = "Squad 3", Vorname = "Wuschel 3", Ort = "Meißen" });
            pers.Add(new PersonModel { Nachname = "Squad 4", Vorname = "Wuschel 4", Ort = "Schwarzenberg" });
            pers.Add(new PersonModel { Nachname = "Squad 5", Vorname = "Wuschel 5", Ort = "Bautzen" });
            pers.Add(new PersonModel { Nachname = "Squad 6", Vorname = "Wuschel 6", Ort = "Chemnitz" });
            personenModel.Personen = pers;

            return View(personenModel.Personen);
        }
    }
}
